package org.goldenmock.web.matchers;

import org.goldenmock.web.server.EasyHttpRequest;

/**
 * @author Robin Wagenaar
 * @author Arjen van Staalduinen
 */
public class ContentRegexMatcher extends EasyRequestMatcher {
    private final String pattern;

    public ContentRegexMatcher(String pattern) {
        this.pattern = pattern;
    }

    @Override
    public boolean matchesEasyRequest(EasyHttpRequest easyHttpRequest) {
        return easyHttpRequest.getContentAsString().matches(pattern);
    }
}
